/**
 * resource1 - end condition, food gathered (small)
 */
package conditions;
import javax.swing.JOptionPane;

import main.*;
public class Resource1 extends Condition{

	/**
	 * constructor
	 * @param o - owner player
	 */
	public Resource1(Player o) {
		super(o, 1);
	}

	/**
	 * check if condition is reached
	 * returns true if complete, false otherwise
	 */
	public boolean checkComplete(){
		if(Owner.getRes().getFood()+Owner.getRes().getMetal()+Owner.getRes().getWood()>=500 && !isComplete()){
			this.complete();
			return true;
		}
		else
			return false;

	}
	public void complete(){
		complete=true;
		Owner.getRes().getScore().AddToScore(pointvalue);
		JOptionPane.showMessageDialog(null, ("You're good at hunting and gathering. Actually, just gathering. +points"));
		}

}
